#-*- coding: utf8 -*-
from tutor.script import *
from tutor.plugin.maple import *

# variáveis úteis
half = M('1/2')
t = M.t
_i, _j, _k = M('_i, _j, _k')
rr = M('`..`')
coeff = M.coeff

# parâmetros iniciais
a = M(oneof(-2, -1, -1, 1, 1, 2, 3))
b = M(oneof(-2, -1, 1, 1, 2, 3))
c = M(oneof(-2, -1, 1, 1, 2, 3))
d = M(oneof(-2, -1, 1, 1, 2, 3))

# campo
F = fieldF = (-a * y) * _i + \
             (a * x + b * z) * _j + \
             (c * (cos(x) ** 2 + sin(y) ** 2) + d * z) * _k

# --- resultados --------------------------------------------------------------
print('campoF: %s' % F)

# correto 
fluxo = 2 * Pi * a
print('fluxo: %s' % fluxo)

# erros
gauss = Pi * d / 2
print('gauss: %s' % gauss)

intarea = 2 * Pi * (b + 2 * a)
print('intarea: %s' % intarea)

rot = 4 * Pi * a
print('rot: %s' % rot)

